#include <iostream>
#include <string>
#include <fstream>

using namespace std;

int main()
{
  fstream fs("/home/rui/projects/network/saveattachment/a.log",ios::out|ios::app);
/*
  string s;
  getline(cin,s);
  while(! cin.fail())
  {
  fs<<s<<endl;
  getline(cin,s);
  }
*/
  string buf((istreambuf_iterator<char>(cin)),istreambuf_iterator<char>());
  fs<<buf;
  return 0;
}

